package com.angcyo.selenium

import org.openqa.selenium.Rectangle

/**
 * Email:angcyo@126.com
 * @author angcyo
 * @date 2020/12/24
 */

fun Int.isValid() = this != Int.MIN_VALUE

fun Float.isValid() = isFinite() && this != Float.MIN_VALUE

fun Rectangle.isValid() = x.isValid() && y.isValid() && width.isValid() && height.isValid() && !isEmpty()

fun Rectangle.isEmpty() = width <= 0 && height <= 0

/**转成css中的px单位*/
fun Any.toPx() = "${this}px"